<script setup lang="ts">
import { ref, PropType } from "vue";
import router from "@/router";
import { Menu } from "@/business/entity/menu.entity";


defineProps({
  menus: {
    type: Array as PropType<Menu[]>,
  },
});

</script>

<template>
  <template v-for="(menu, key) in menus" :key="key">
      <el-sub-menu :route="menu.path" :index="menu.index" v-if="menu.children.length > 0">
        <template #title>
          <el-icon><component :is="menu.icon" /></el-icon>
          <span>{{ menu.menuName }}</span>
        </template>
        <TarotMenuTree :menus="menu.children"></TarotMenuTree>
      </el-sub-menu>
      <el-menu-item :route="menu.path" :index="menu.index" v-else>
        <el-icon><component :is="menu.icon" /></el-icon>
        <template #title>
          <span>{{ menu.menuName }}</span>
        </template>
      </el-menu-item>
  </template>
</template>
